-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(frontend): support explain format json
#19041
Conversation
explain format json
7a18ef4
to
0ece979
Compare
QQ: Is this just for debugging and not ready to be used widely by users? I assume the format is not finalized and will be subject to change. (If so we can happily merge and try it quickly) |
Yeah it's mainly for us to get a structured output of the users query plan. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM
(But did not read / play with the format. If it's not finalized, I think we can play with it and refine it as needed
Do we want to document it now? If yes, we should note format stability |
0ece979
to
babdbb1
Compare
12e47c7
to
36af875
Compare
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
Closes #18816 #17218 #14168
We just use the
Pretty
IR, wrap it in a newtype, derive a serde instance for it.We intentionally do NOT use serde already implemented for the proto output of the to_proto phase (i.e. when
to_stream_prost / to_batch_prost
are called). That's because it locks the plan type to thestream_proto / batch_proto
type.EXPLAIN FORMAT JSON should only change the format, and not determine the underlying plan type (logical / stream / batch / to_proto).
Explain terse doesn't need to be supported. Using the json output, we can just do (see before/after below):
before
after
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note
Public Preview: Do note that the structure and format of EXPLAIN FORMAT JSON is considered unstable, and may change overtime.
After this PR, a new
explain option
is supportedFor
FORMAT JSON
, it will output json forlogical
andphysical
plans, while it ignorestrace, distsql
options.For
FORMAT TEXT
, the output is the same as the current output format of explain.Here's an example: